package com.pureland.boot.ext;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @projectName: pureland_cloud
 * @className: com.pureland.boot.config.ext.NoRepeatSubmitAutoConfiguration
 * @description: 防止表单重复提交自动配置
 * @author: tong.li
 * @createTime: 2020/10/13 10:44
 * @version: v1.0
 * @copyright: 版权所有 李彤 © 2020
 */
@Configuration
@ConditionalOnWebApplication
@ConditionalOnProperty(prefix = "pureland.web.no-repeat-submit", value = "enabled", matchIfMissing = true)
public class NoRepeatSubmitAutoConfiguration {


    @Bean
    @ConditionalOnMissingBean(NoRepeatSubmitAspect.class)
    public NoRepeatSubmitAspect noRepeatSubmitAspect() {
        return new NoRepeatSubmitAspect();
    }



}
